Load Balancer
💡 Definition
An Elastic Load Balancer (ELB) automatically distributes incoming application traffic across multiple targets, such as EC2 instances, containers, IP addresses, and Lambda functions. It increases the fault tolerance of your applications.
🔑 Key Concepts
- Distributes Traffic: Spreads client requests efficiently among healthy targets.
- Health Checks: Monitors the health of registered targets and routes traffic only to healthy ones.
- High Availability: Works across multiple AZs to ensure your application remains available even if one AZ fails.
- Types of Load Balancers:
- Application Load Balancer (ALB): Best for HTTP/HTTPS traffic, operates at Layer 7 (application layer).
- Network Load Balancer (NLB): Best for ultra-high performance and static IP addresses, operates at Layer 4 (transport layer).
- Gateway Load Balancer (GLB): Deploying, scaling, and managing virtual appliances.
- Classic Load Balancer (CLB): Older generation, not recommended for new applications.
⚙️ How it Works
- Client Request: A user sends a request to the Load Balancer's DNS name.
- Traffic Distribution: The Load Balancer uses its listeners and rules to route the request to a healthy target.
- Health Monitoring: Continuously checks the health of registered instances.
🎯 Use Cases
- Distributing Web Traffic: Spreading load for high-traffic websites.
- High Availability: Ensuring no single point of failure for traffic.
- Scaling: Working with Auto Scaling to handle fluctuating demand.
- SSL Termination: Offloading SSL encryption/decryption from backend instances.
💰 Pricing Model
- Charged for each Load Balancer hour or partial hour.
- Charged for the amount of data processed by the Load Balancer.
- Additional charges for Load Balancer Capacity Units (LCUs) for ALBs and NLBs.
📝 Exam Tips (CLF-C02)
- Key for High Availability and Fault Tolerance for web applications.
- Used in conjunction with Auto Scaling for elastic scaling.
- Know the main difference between ALB (HTTP/S) and NLB (TCP/UDP, high performance).
See Also: * EC2 * Auto Scaling * Route 53